﻿using GISforTT_API;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using ESRI.ArcGIS.Client.Geometry;
using System.Windows;

namespace GISforTT_Test
{
    /// <summary>
    ///This is a test class for BookmarkTest and is intended
    ///to contain all BookmarkTest Unit Tests
    ///</summary>
    [TestClass()]
    public class BookmarkTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Bookmark Constructor
        ///</summary>
        [TestMethod()]
        public void BookmarkConstructorTest()
        {
            Envelope envelope = new Envelope(new MapPoint(120, 10), new MapPoint(120, 20));
            string description = "A Test";
            string Id = "The ID";
            Bookmark.BookmarkPriority p = Bookmark.BookmarkPriority.High;
            Bookmark target = new Bookmark(envelope, description, Id, p);
            
            Assert.AreEqual(envelope, target.MapFrameEnvelope);
            Assert.AreEqual(description, target.Description);
            Assert.AreEqual(Id, target.ID);
            Assert.AreEqual(p, target.Priority);
        }

        /// <summary>
        ///A test for Bookmark Constructor
        ///</summary>
        [TestMethod()]
        public void BookmarkConstructorTest1()
        {
            MapPoint location = new MapPoint(110, 20);
            string description = "Another Test";
            string Id = "The new ID";
            Bookmark.BookmarkPriority p = Bookmark.BookmarkPriority.Low;
            Bookmark target = new Bookmark(location, description, Id, p);

            Assert.AreEqual(location, target.MapCoordinate);
            Assert.AreEqual(description, target.Description);
            Assert.AreEqual(Id, target.ID);
            Assert.AreEqual(p, target.Priority);
        }

        /// <summary>
        ///A test for getBookmarkPriorityString
        ///</summary>
        [TestMethod()]
        public void getBookmarkPriorityStringTest()
        {
            MapPoint location = new MapPoint(100, 50);
            string description = "Testing the Priority String";
            string Id = "An ID";
            Bookmark.BookmarkPriority p = Bookmark.BookmarkPriority.Medium;
            Bookmark target = new Bookmark(location, description, Id, p);

            string expected = "Medium";
            string actual;
            actual = target.getBookmarkPriorityString();
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for Description
        ///</summary>
        [TestMethod()]
        public void DescriptionTest()
        {
            MapPoint location = new MapPoint(110, 20);
            string description = "Another Test";
            string Id = "The new ID";
            Bookmark.BookmarkPriority p = Bookmark.BookmarkPriority.Low;
            Bookmark target = new Bookmark(location, description, Id, p);

            string expected = "The new Desc";
            string actual;
            target.Description = expected;
            actual = target.Description;
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for ID
        ///</summary>
        [TestMethod()]
        public void IDTest()
        {
            MapPoint location = new MapPoint(110, 20);
            string description = "Another Test";
            string Id = "The new ID";
            Bookmark.BookmarkPriority p = Bookmark.BookmarkPriority.Low;
            Bookmark target = new Bookmark(location, description, Id, p);

            string expected = "The new ID";
            string actual;
            target.ID = expected;
            actual = target.ID;
            Assert.AreEqual(expected, actual);            
        }

        
        ///// <summary>
        /////A test for MapFrameCenter
        /////</summary>
        //[TestMethod()]
        //public void MapFrameCenterTest()
        //{
        //    MapPoint location = null; // TODO: Initialize to an appropriate value
        //    string description = string.Empty; // TODO: Initialize to an appropriate value
        //    string Id = string.Empty; // TODO: Initialize to an appropriate value
        //    Bookmark.BookmarkPriority p = new Bookmark.BookmarkPriority(); // TODO: Initialize to an appropriate value
        //    Bookmark target = new Bookmark(location, description, Id, p); // TODO: Initialize to an appropriate value
        //    Point expected = new Point(); // TODO: Initialize to an appropriate value
        //    Point actual;
        //    target.MapFrameCenter = expected;
        //    actual = target.MapFrameCenter;
        //    Assert.AreEqual(expected, actual);
        //    Assert.Inconclusive("Verify the correctness of this test method.");
        //}

        /// <summary>
        ///A test for MapFrameCurrentlyOpen
        ///</summary>
        [TestMethod()]
        public void MapFrameCurrentlyOpenTest()
        {
            MapPoint location = new MapPoint(110, 20);
            string description = "Another Test";
            string Id = "The new ID";
            Bookmark.BookmarkPriority p = Bookmark.BookmarkPriority.Low;
            Bookmark target = new Bookmark(location, description, Id, p);

            bool expected = false;
            Assert.AreEqual(expected, target.MapFrameCurrentlyOpen);
            
        }


        ///// <summary>
        /////A test for MapFrameHeight
        /////</summary>
        //[TestMethod()]
        //public void MapFrameHeightTest()
        //{
        //    MapPoint location = null; // TODO: Initialize to an appropriate value
        //    string description = string.Empty; // TODO: Initialize to an appropriate value
        //    string Id = string.Empty; // TODO: Initialize to an appropriate value
        //    Bookmark.BookmarkPriority p = new Bookmark.BookmarkPriority(); // TODO: Initialize to an appropriate value
        //    Bookmark target = new Bookmark(location, description, Id, p); // TODO: Initialize to an appropriate value
        //    double expected = 0F; // TODO: Initialize to an appropriate value
        //    double actual;
        //    target.MapFrameHeight = expected;
        //    actual = target.MapFrameHeight;
        //    Assert.AreEqual(expected, actual);
        //    Assert.Inconclusive("Verify the correctness of this test method.");
        //}

        ///// <summary>
        /////A test for MapFrameOrientation
        /////</summary>
        //[TestMethod()]
        //public void MapFrameOrientationTest()
        //{
        //    MapPoint location = null; // TODO: Initialize to an appropriate value
        //    string description = string.Empty; // TODO: Initialize to an appropriate value
        //    string Id = string.Empty; // TODO: Initialize to an appropriate value
        //    Bookmark.BookmarkPriority p = new Bookmark.BookmarkPriority(); // TODO: Initialize to an appropriate value
        //    Bookmark target = new Bookmark(location, description, Id, p); // TODO: Initialize to an appropriate value
        //    double expected = 0F; // TODO: Initialize to an appropriate value
        //    double actual;
        //    target.MapFrameOrientation = expected;
        //    actual = target.MapFrameOrientation;
        //    Assert.AreEqual(expected, actual);
        //    Assert.Inconclusive("Verify the correctness of this test method.");
        //}

        /// <summary>
        ///A test for MapFramePreviouslyOpen
        ///</summary>
        [TestMethod()]
        public void MapFramePreviouslyOpenTest()
        {
            MapPoint location = new MapPoint(110, 20);
            string description = "Another Test";
            string Id = "The new ID";
            Bookmark.BookmarkPriority p = Bookmark.BookmarkPriority.Low;
            Bookmark target = new Bookmark(location, description, Id, p);

            bool expected = false;
            Assert.AreEqual(expected, target.MapFramePreviouslyOpen);            
        }

        ///// <summary>
        /////A test for MapFrameWidth
        /////</summary>
        //[TestMethod()]
        //public void MapFrameWidthTest()
        //{
        //    MapPoint location = null; // TODO: Initialize to an appropriate value
        //    string description = string.Empty; // TODO: Initialize to an appropriate value
        //    string Id = string.Empty; // TODO: Initialize to an appropriate value
        //    Bookmark.BookmarkPriority p = new Bookmark.BookmarkPriority(); // TODO: Initialize to an appropriate value
        //    Bookmark target = new Bookmark(location, description, Id, p); // TODO: Initialize to an appropriate value
        //    double expected = 0F; // TODO: Initialize to an appropriate value
        //    double actual;
        //    target.MapFrameWidth = expected;
        //    actual = target.MapFrameWidth;
        //    Assert.AreEqual(expected, actual);
        //    Assert.Inconclusive("Verify the correctness of this test method.");
        //}

    }
}
